//
//  EnterView.m
//  A段项目
//
//  Created by ～whc on 15-6-20.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "EnterView.h"
#define Height 50
#define Width 40
@implementation EnterView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self create];
    }
    return self;
}
//布置页面
- (void)create
{
    self.nameImageView = [[UIImageView alloc]initWithFrame:CGRectMake(Width, Height, Width, Height)];
    [self.nameImageView setBackgroundColor:[UIColor clearColor]];
    self.nameImageView.image = [UIImage imageNamed:@"login_account_icon.png"];
    [self addSubview:self.nameImageView];
    
    self.secretImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.nameImageView.frame.origin.x, self.nameImageView.frame.origin.y + self.nameImageView.frame.size.height + 30, Width, Height)];
    [self.secretImageView setBackgroundColor:[UIColor clearColor]];
    self.secretImageView.image = [UIImage imageNamed:@"login_password_icon.png"];
    [self addSubview:self.secretImageView];
    
    self.nameTextField = [[UITextField alloc] initWithFrame:CGRectMake(self.nameImageView.frame.origin.x + self.nameImageView.frame.size.width + 10, self.nameImageView.frame.origin.y, 5 * Width, Height)];
    self.nameTextField.placeholder = @"请输入你的账户名称";
    [self.nameTextField setBackgroundColor:[UIColor clearColor]];
    [self addSubview:self.nameTextField];
    
    self.secretTextField = [[UITextField alloc] initWithFrame:CGRectMake(self.nameTextField.frame.origin.x, self.secretImageView.frame.origin.y, 5 * Width, Height)];
    self.secretTextField.placeholder = @"请输入你的密码";
    [self.secretTextField setBackgroundColor:[UIColor clearColor]];
    [self addSubview:self.secretTextField];

    self.enterButton = [[UIButton alloc] initWithFrame:CGRectMake(3 * Width, self.secretImageView.frame.origin.y + self.secretImageView.frame.size.height + 20, 4 * Width , 30)];
    [self.enterButton setBackgroundColor:[UIColor clearColor]];
    [self.enterButton setTitle:@"登录" forState:UIControlStateNormal];
    [self.enterButton setBackgroundImage:[UIImage imageNamed:@"btn_solid_blue_h90.9.png"] forState:UIControlStateNormal];
    [self.enterButton addTarget:self action:@selector(enterButtonAction) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.enterButton];
    
}

- (void)enterButtonAction
{
    [self.enterDelegate present];
    
}





@end
